{extend name="public:layout" /}

{block name="title"}
	<title>{:site('siteName')}-邀请好友</title>
{/block}

{block name="css"}
	<link rel="stylesheet" type="text/css" href="__STATIC__/{$theme}/css/user.css">
	<link rel="stylesheet" href="__STATIC__/share/css/share.css" type="text/css" />
{/block}

{block name="content"}
	<div class="layui-main">
		<div class="user-main">
			<div class="user-left">
				{include file="public:user" index="2" /}
			</div>
			<div class="user-right">
				<div class="layui-tab layui-tab-brief">
					<ul class="layui-tab-title">
						<li class="layui-this">邀请好友</li>
					</ul>
					<div class="layui-tab-content">
						<form class="layui-form user-info">
							<div class="layui-form-item">
							    <label class="layui-form-label">邀请码：</label>
							    <div class="user-id">{:session('user.user_id')}</div>
							</div>
							<div class="layui-form-item">
							    <label class="layui-form-label">邀请链接：</label>
							    <div class="layui-input-block">
							    	<input type="text" name="url" value="{:request()->domain()}/register/{:session('user.user_id')}" readonly="true" class="layui-input">
							    </div>
							</div>
							<div class="layui-form-item">
							    <label class="layui-form-label">邀请收入</label>
							    <div class="user-id">¥{$U['invite_money']}</div>
							</div>
							
						</form>
					</div>
				</div>
				<div class="layui-tab layui-tab-brief">
					<ul class="layui-tab-title">
						<li class="layui-this">我的邀请</li>
					</ul>
					<div class="layui-tab-content">
						<table class="table">
						    <colgroup>
							    <col width="100">
							    <col width="100">
							    <col width="100">
							    <col width="100">
						    	<col width="100">
						    </colgroup>
						    <thead>
						        <tr>
						            <th>用户名</th>
						            <th>QQ号</th>
						            <th>微信</th>
						            <th>邀请时间</th>
						        </tr>
						    </thead>
						    <tbody>
						    	{volist name="invites" id="v"}
							        <tr>
							            <td>{$v.username}</td>
							            <th>{$v.qq}</th>
							            <th>{$v.wechat}</th>
							            <td>{:date('Y-m-d',$v['create_time'])}</td>
							        </tr>
						        {/volist}
						    </tbody>
						</table>
					</div>
				</div> 
			</div>
		</div>
	</div>
{/block}

{block name="script"}
	<script src="__STATIC__/share/js/share.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function() {
            $("#share").socialShare({
                content: '分享赚不停',
				url:'{:request()->domain()}/register/{:session('user.user_id')}',
				titile:'分享好友'
            });
            $(".msb_main").trigger('click');
        });
	</script>
{/block}